<%@ include file="../common/top.jsp"%>

<link rel="stylesheet" type="text/css" href="css/order.css">

<div class="table-container">
    <table>
        <tr>
            <th colspan="5">Order#${sessionScope.order.orderDate}</th>
        </tr>
        <tr>
            <th colspan="5">Payment details</th>
        </tr>
        <tr>
            <td>Card Type:</td>
            <td colspan="4">${sessionScope.order.cardType}</td>
        </tr>
        <tr>
            <td>Card Number:</td>
            <td colspan="4">${sessionScope.order.creditCard}</td>
        </tr>
        <tr>
            <td>Expiry Date(MM/YYYY):</td>
            <td colspan="4">${sessionScope.order.expiryDate}</td>
        </tr>

        <tr>
            <th colspan="5">Billing Address</th>
        </tr>
        <tr>
            <td>First name:</td>
            <td colspan="4">${sessionScope.loginAccount.firstName}</td>
        </tr>
        <tr>
            <td>Last name:</td>
            <td colspan="4">${sessionScope.loginAccount.lastName}</td>
        </tr>
        <tr>
            <td>Address1:</td>
            <td colspan="4">${sessionScope.loginAccount.address1}</td>
        </tr>
        <tr>
            <td>Address2:</td>
            <td colspan="4">${sessionScope.loginAccount.address2}</td>
        </tr>
        <tr>
            <td>City:</td>
            <td colspan="4">${sessionScope.loginAccount.city}</td>
        </tr>
        <tr>
            <td>State:</td>
            <td colspan="4">${sessionScope.loginAccount.state}</td>
        </tr>
        <tr>
            <td>Zip:</td>
            <td colspan="4">${sessionScope.loginAccount.zip}</td>
        </tr>
        <tr>
            <td>Country:</td>
            <td colspan="4">${sessionScope.loginAccount.country}</td>
        </tr>

        <tr>
            <th colspan="5">Shipping Address</th>
        </tr>
        <tr>
            <td>First name:</td>
            <td colspan="4">${sessionScope.order.shipToFirstName}</td>
        </tr>
        <tr>
            <td>Last name:</td>
            <td colspan="4">${sessionScope.order.shipToLastName}</td>
        </tr>
        <tr>
            <td>Address1:</td>
            <td colspan="4">${sessionScope.order.shipAddress1}</td>
        </tr>
        <tr>
            <td>Address2:</td>
            <td colspan="4">${sessionScope.order.shipAddress2}</td>
        </tr>
        <tr>
            <td>City:</td>
            <td colspan="4">${sessionScope.order.shipCity}</td>
        </tr>
        <tr>
            <td>State:</td>
            <td colspan="4">${sessionScope.order.shipState}</td>
        </tr>
        <tr>
            <td>Zip:</td>
            <td colspan="4">${sessionScope.order.shipZip}</td>
        </tr>
        <tr>
            <td>Country:</td>
            <td colspan="4">${sessionScope.order.shipCountry}</td>
        </tr>


        <tr>
            <th colspan="5">Status:${sessionScope.item.status}</th>
        </tr>

        <tr>
            <th>ItemId</th>
            <th>Description</th>
            <th>Quantity</th>
            <th>Price</th>
            <th>Total Cost</th>
        </tr>

        <c:forEach var="cartItem" items="${sessionScope.cart.cartItems}">
            <tr>
                <td>${cartItem.item.itemId}</td>
                <td>
                        ${cartItem.item.attribute1}
                        ${cartItem.item.product.description}
                </td>
                <td>${cartItem.quantity}</td>
                <td>${cartItem.item.listPrice}</td>
                <td>${cartItem.quantity * cartItem.item.listPrice}</td>
            </tr>
        </c:forEach>

        <tr>
            <th colspan="5">Total:${sessionScope.order.totalPrice}</th>
        </tr>
    </table>
</div>

<%@ include file="../common/bottom.jsp"%>
